/**
 * 
 */
package com.lvmama.vst.activemq.producer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author fengyonggang
 *
 */
@Component
public class MessageSender {

	private static final Logger LOGGER = LoggerFactory.getLogger(MessageSender.class);
	
	@Autowired
	private JmsMessagingTemplate jmsMessagingTemplate;
	
	@Scheduled(fixedDelay = 3000L)
	public void send() {
		LOGGER.info("sending a message...");
		jmsMessagingTemplate.convertAndSend("foo","Hello");
	}
}
